package cn.qinhao.pethome.system.domain;

import cn.qinhao.pethome.basic.base.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author qinhao
 * @since 2023-03-04
 */
@Data
public class Menu extends BaseDomain{

    private static final long serialVersionUID = 1L;

    private String name;
    private String component;
    private String url;
    private String icon;
    private Integer index;
    private Long parentId;
    private String intro;
    private Boolean state;
    //声明一个保存子部门的容器(因为刚开始本来就是空，所以为了防止后面第一次调用的时候空指针，先new一个list集合)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)//去掉空的儿子
    private List<Menu> children = new ArrayList<>();//此处规定必须是children
    //添加父级菜单
    private Menu parent;
}
